﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ProgNetComponents.Design.Attributes
{
    /// <summary>
    /// Property with this attribute will always be serialized
    /// </summary>
    [AttributeUsage(AttributeTargets.Property)]
    public sealed class AlwaysSerializeAttribute : Attribute
    {
        /// <summary>
        /// Default value
        /// </summary>
        public static readonly AlwaysSerializeAttribute Yes = new AlwaysSerializeAttribute();
       
        /// <summary>
        ///  returns a value that indicates whether this instance equals a specified object.
        /// </summary>
        /// <param name="obj">object to check</param>
        /// <returns>true if values match</returns>
        public override bool Match(object obj)
        {
            if (obj is AlwaysSerializeAttribute)
                return true;
            return false;
        }
    }
}
